home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume22 / sc / patch01a next >
Encoding:
Text File  |  1991-09-20  |  50.5 KB  |  1,756 lines

  1. Newsgroups: comp.sources.misc
  2. From: uunet!sawmill!prslnk!buhrt (Jeff Buhrt)
  3. Subject:  REPOST: v22i095:  sc - The SC Spreadsheet, release 6.16, Patch01a/2
  4. Message-ID: <1991Sep20.143324.5998@sparky.imd.sterling.com>
  5. X-Md4-Signature: ae2e70f73bf50230d7bdc8ef7b6e8940
  6. Date: Fri, 20 Sep 1991 14:33:24 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: uunet!sawmill!prslnk!buhrt (Jeff Buhrt)
  10. Posting-number: Volume 22, Issue 95
  11. Archive-name: sc/patch01a
  12. Environment: UNIX, VMS, MS-DOS
  13. Patch-To: sc: Volume 20, Issue 35-41
  14.  
  15. [ This is being reposted due to a propagation error. ]
  16.  
  17. This is the first part of a  two  part SHAR archive that must be 
  18. extracted before applying pch616-617 to Sc6.16. The new revision 
  19. level will be: 6.17.
  20.  
  21. To see what this changes see CHANGES down about 30 lines. There
  22. There were no major bugs, just a few small fixes, new features, 
  23. and new hardware/OS platforms.
  24.  
  25.                     -Jeff Buhrt
  26.                 {sequent,uunet}!sawmill!prslnk!buhrt
  27.                 812-275-0750 work
  28.                 Proslink, Inc.
  29. ----
  30. #!/bin/sh
  31. # This is a shell archive (produced by shar 3.49)
  32. # To extract the files from this archive, save it to a file, remove
  33. # everything above the "!/bin/sh" line above, and type "sh file_name".
  34. #
  35. # This is part 1 of a multipart archive                                    
  36. # do not concatenate these parts, unpack them in order with /bin/sh        
  37. #
  38. # This shar contains:
  39. # length  mode       name
  40. # ------ ---------- ------------------------------------------
  41. #  72450 -rw-rw-rw- pch616-617
  42. #    189 -r--r--r-- torev
  43. #
  44. if test -r _shar_seq_.tmp; then
  45.     echo 'Must unpack archives in sequence!'
  46.     echo Please unpack part `cat _shar_seq_.tmp` next
  47.     exit 1
  48. fi
  49. # ============= pch616-617 ==============
  50. if test -f 'pch616-617' -a X"$1" != X"-c"; then
  51.     echo 'x - skipping pch616-617 (File already exists)'
  52.     rm -f _shar_wnt_.tmp
  53. else
  54. > _shar_wnt_.tmp
  55. echo 'x - extracting pch616-617 (Text)'
  56. sed 's/^X//' << 'SHAR_EOF' > 'pch616-617' &&
  57. *** 6.16    1991/06/04 18:55:36
  58. --- CHANGES    1991/09/04 14:27:59
  59. ***************
  60. *** 1,3 ****
  61. --- 1,48 ----
  62. + CHANGES BETWEEN 6.17 and 6.16
  63. + Ulf Noren
  64. +     - added cell locking, disallowing input, to ranges of cells
  65. + Herr Soeryantono
  66. +     - I added ifdef's around curses KEY_* functions his curses didn't have
  67. +         (Sun/OS 4 on a SPARC)
  68. + Jay Lepreau
  69. +     - changes to tutorial.sc: how to get out, should be used w/ 24 lines
  70. +     - IDLOKBAD was not passed to screen.c
  71. +     - suggested error messages if the execl of crypt fails
  72. +     - pointed out BSD's crypt is in /usr/bin/crypt
  73. + Henk P. Penning
  74. +     - suggested Makefile list the mode of the man page & tutorial.sc
  75. +     - make install will now install the psc man
  76. +     - yylval was not known in lex.c for HP-UX 7.05
  77. + Edgard
  78. +     - hitwinch fixes
  79. +     - KEY_HOME now takes you to 0,0
  80. + CHECK KEY_NPAGE/PPAGE
  81. + Stephen (Steve) M. Brooks
  82. +     - suggested the man pages should include Sc's revision
  83. + Dan Banay
  84. +     - code to set LINES and COLS after a window size change
  85. + Bart Schaefer
  86. +     - @myrow/@mycol fix
  87. + Bruce Jerrick
  88. +     - noted ln may not always work for the temporary source files
  89. + Gene H. Olson
  90. +     - fixes for SIGWINCH for Sun OS 4.1.1
  91. + Teus Hagen
  92. +     - added three functions:
  93. +         1) allow @PI as well
  94. +         2) @upper/@lower for casing characters in a string
  95. +         3) @capital for upper case first char of words in a string.
  96. + Martin Maclaren
  97. +     - added MS-DOS support
  98. +         COMPILER USED: Microsoft C, 5.1
  99. +         TOOLS USED   : NDMAKE GNUBISON GNUSED PCCURSES
  100. + Cuong Bui
  101. +     - has a working Vietnamese version of sc, noted a A_CHARTEXT
  102. +         mask problem
  103. + Jeff Buhrt
  104. +     - when numeric prescale is on: 300 -> 3.0, now 300. -> 300. not 3.0
  105. +         (numbers with a decimal aren't scaled)
  106. X  CHANGES BETWEEN 6.16 and 6.15
  107. X  Tom Tkacik
  108. X      -fixed a bug in ^W
  109. *** 6.16    1991/06/04 18:57:22
  110. --- README    1991/09/04 14:27:58
  111. ***************
  112. *** 1,8 ****
  113. X  This is a much modified version of the public domain spread sheet sc,
  114. X  posted several years ago by Mark Weiser as vc, originally by James Gosling.
  115. X  
  116. ! CHANGES lists the changes since 6.1 to 6.15.
  117. ! Current maintainer: {sequent, tippy.cs.purdue.edu}!sawmill!buhrt (Jeff Buhrt)
  118. X  
  119. X  When you get it built, try "sc tutorial.sc" for a simple introduction
  120. X  to the basic commands.
  121. --- 1,8 ----
  122. X  This is a much modified version of the public domain spread sheet sc,
  123. X  posted several years ago by Mark Weiser as vc, originally by James Gosling.
  124. X  
  125. ! CHANGES lists the changes since 6.1 to 6.17.
  126. ! Current maintainer: {sequent, uunet}!sawmill!prslnk!buhrt (Jeff Buhrt)
  127. X  
  128. X  When you get it built, try "sc tutorial.sc" for a simple introduction
  129. X  to the basic commands.
  130. ***************
  131. *** 13,19 ****
  132. X  If you have the command 'file' that uses /etc/magic add the line:
  133. X  38    string        Spreadsheet    sc file
  134. X  
  135. ! Psc formats ascii files for use in the spread sheet.  If you don't have
  136. X  getopts, there is a public domain version by Henry Spencer hidden away in
  137. X  the VMS_NOTES file.
  138. X  
  139. --- 13,19 ----
  140. X  If you have the command 'file' that uses /etc/magic add the line:
  141. X  38    string        Spreadsheet    sc file
  142. X  
  143. ! Psc formats ascii files for use in the spreadsheet.  If you don't have
  144. X  getopts, there is a public domain version by Henry Spencer hidden away in
  145. X  the VMS_NOTES file.
  146. X  
  147. ***************
  148. *** 36,69 ****
  149. X  makefile).  SIMPLE causes the arrow keys to not be used.
  150. X  
  151. X  If you have problems with your yacc saying: too many terminals ...127...
  152. ! Comment out the gram.c and y.tab.c code in Makefile and uncomment the
  153. ! section that uses mygram.c and myy.tab.h.
  154. X  
  155. X  Guidelines for Hackers:
  156. X  
  157. X  If you want to send changes you have made to SC, please feel free to do
  158. ! so.  If they work :-) and seem worthwhile, I'll put them in.  Please
  159. ! refrain from wholesale "style" or "cleanup" changes.  It is easy to add
  160. ! your changes but it makes it hard to merge in the next guy's stuff if
  161. ! he used the release as a base.  Leave my $Revision:  identifiers alone-
  162. ! they help me track what you used as a base.  If you check the code into
  163. ! rcs, delete the "$"s on the Revison lines before you do.
  164. ! You may not like 4 space indenting and curly braces on the "if" line, but
  165. ! your code will look like that before it leaves my hands so you may as well
  166. ! abide by the style in the code when you make your changes.  I have also been
  167. ! known to break things trying to make them look "right".  If you do string
  168. ! functions, please, PLEASE pay attention to null pointers, use xmalloc,
  169. ! xrealloc, and xfree; and xfree those arguments.  And don't forget to
  170. ! document your changes in both help.c and sc.doc.
  171. X  
  172. X  Disclaimer:
  173. X  
  174. X  Starting 4/4/90: (I will be maintaining Sc for a while at least,
  175. X      Robert Bond has been very busy lately)
  176. - Sc is not a product of Grauel Enterprises, Inc.  It is supplied as
  177. - is with no warranty, express or implied, as a service to Usenet readers.
  178. - It is not copyrighted, either.  Have at it.
  179. X  
  180. X  Archives:
  181. X  1) (FTP) jpd@usl.edu James Dugal
  182. --- 36,71 ----
  183. X  makefile).  SIMPLE causes the arrow keys to not be used.
  184. X  
  185. X  If you have problems with your yacc saying: too many terminals ...127...
  186. ! Find a different yacc: bison, Berkeley yacc, Pd yacc, etc. AT&T's Sys V
  187. ! yacc has small, fixed sized tables. SCO will allow dynamic yacc tables
  188. ! when given the correct flags.
  189. X  
  190. X  Guidelines for Hackers:
  191. X  
  192. X  If you want to send changes you have made to SC, please feel free to do
  193. ! so.  If they work :-) and seem worthwhile, I'll put them in.
  194. X  
  195. + a) Please refrain from wholesale "style" or "cleanup" changes.  It is easy
  196. +     to add your changes but it makes it hard to merge in the next guy's
  197. +     stuff if he used the release as a base.  Suggestions are welcome.
  198. + b) Leave my $Revision:  identifiers alone-they help me track what you used
  199. +     as a base.  If you check the code into rcs, delete the "$"s on the
  200. +     Revison lines before you do.
  201. + c) Please abide by the style in the code when you make your changes.  It is easy
  202. +      to break things trying to make them look "right".
  203. + d) If you do string functions, please, PLEASE pay attention to null pointers,
  204. +     use xmalloc, xrealloc, and xfree; and xfree those arguments.
  205. + e) Please don't forget to document your changes in both help.c and sc.doc.
  206. + f) WHEN sending diffs: please use diff -c (context diff, and possibly
  207. +     more than three lines on each side), I get a lot of code and
  208. +     things move.
  209. + g) Please send an explanation of what your code does and how to use/test it.
  210. X  Disclaimer:
  211. X  
  212. X  Starting 4/4/90: (I will be maintaining Sc for a while at least,
  213. X      Robert Bond has been very busy lately)
  214. X  
  215. X  Archives:
  216. X  1) (FTP) jpd@usl.edu James Dugal
  217. ***************
  218. *** 76,82 ****
  219. X    Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
  220. X    (Grab dumbcat!~/INDEX for a complete list)
  221. X  
  222. X                      Jeff Buhrt
  223. !                     Grauel Enterprises, Inc.
  224. !                     sequent!sawmill!buhrt
  225. X  
  226. --- 78,88 ----
  227. X    Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
  228. X    (Grab dumbcat!~/INDEX for a complete list)
  229. X  
  230. + Sc is not a product of ProsLink, Inc.  It is supplied as is with no
  231. + warranty, express or implied, as a service to Usenet readers.  It is not
  232. + copyrighted, either.  Have at it.
  233. X                      Jeff Buhrt
  234. !                     ProsLink, Inc.
  235. !                     {sequent, uunet}!sawmill!prslnk!buhrt
  236. X  
  237. *** 6.16    1991/06/04 18:57:22
  238. --- sc.doc    1991/09/04 14:28:02
  239. ***************
  240. *** 15,23 ****
  241. X  .\" - TPs use default indent except for function names, then 18.
  242. X  .\" - Smallify uppercase strings.
  243. X  .\" - Avoid passive voice and third person.
  244. ! .\" $Revision: 6.16 $
  245. X  .\"
  246. ! .TH PNAME 1
  247. X  .SH NAME
  248. X  pname \- spreadsheet calculator
  249. X  .SH SYNOPSIS
  250. --- 15,23 ----
  251. X  .\" - TPs use default indent except for function names, then 18.
  252. X  .\" - Smallify uppercase strings.
  253. X  .\" - Avoid passive voice and third person.
  254. ! .\" $Revision: 6.17 $
  255. X  .\"
  256. ! .TH PNAME\ #REVISION#\  1
  257. X  .SH NAME
  258. X  pname \- spreadsheet calculator
  259. X  .SH SYNOPSIS
  260. ***************
  261. *** 1161,1166 ****
  262. --- 1161,1176 ----
  263. X  as long as they occur after the first three alpha characters.
  264. X  .\" ----------
  265. X  .TP
  266. + .B /l
  267. + Use this command to lock the current cell or a range of cells, i.e
  268. + make them immune to any type of editing. A locked cell can't be changed
  269. + in anyway until it is unlocked.
  270. + .TP
  271. + .B /U
  272. + This command is the opposite of the
  273. + .I /l
  274. + command and thus unlocks a locked cell and makes it editable.
  275. + .TP
  276. X  .B /s
  277. X  This command lists (shows) the currently defined range names.
  278. X  If there are no defined range names, then a message is given,
  279. ***************
  280. *** 1866,1871 ****
  281. --- 1876,1892 ----
  282. X  Be sure the table doesn't move unexpectedly!
  283. X  .\" ----------
  284. X  .TP 18
  285. + .BR @upper (e)
  286. + and
  287. + .BR @lower (e)
  288. + will case the string expression to upper or lower.
  289. + .\" ----------
  290. + .TP 18
  291. + .BR @capital (e)
  292. + will convert the first letter of words in a string
  293. + into upper case.
  294. + .\" ----------
  295. + .TP 18
  296. X  .BR @ext (se,e)
  297. X  Call an external function (program or script).
  298. X  The purpose is to allow arbitrary functions on values,
  299. ***************
  300. *** 2094,2101 ****
  301. X  .IR sc ,
  302. X  and further modified by numerous contributors,
  303. X  Jeff Buhrt
  304. ! of Grauel Enterprises, Inc.
  305. ! ({pur-phy (aka: gibbs.physics.purdue.edu), sequent}!sawmill!buhrt)
  306. X  and Robert Bond of Sequent,
  307. X  prominent among them.
  308. X  Other contributors include:
  309. --- 2115,2122 ----
  310. X  .IR sc ,
  311. X  and further modified by numerous contributors,
  312. X  Jeff Buhrt
  313. ! of Proslink, Inc.
  314. ! ({sequent, uunet}!sawmill!prslnk!buhrt)
  315. X  and Robert Bond of Sequent,
  316. X  prominent among them.
  317. X  Other contributors include:
  318. ***************
  319. *** 2102,2112 ****
  320. --- 2123,2137 ----
  321. X  Tom Anderson,
  322. X  Glenn T. Barry,
  323. X  Gregory Bond,
  324. + Stephen (Steve) M. Brooks,
  325. X  Peter Brower,
  326. X  John Campbell,
  327. X  Lawrence Cipriani,
  328. X  Jim Clausing,
  329. + Dave Close,
  330. X  Chris Cole,
  331. + Jonathan Crompron
  332. + David I. Dalva,
  333. X  Glen Ditchfield,
  334. X  Sam Drake,
  335. X  James P. Dugal,
  336. ***************
  337. *** 2114,2119 ****
  338. --- 2139,2145 ----
  339. X  Andy Fyfe,
  340. X  Jack Goral,
  341. X  Piercarlo "Peter" Grandi,
  342. + Henk Hesselink
  343. X  Jeffrey C Honig,
  344. X  Kurt Horton,
  345. X  Jonathan I. Kamens,
  346. ***************
  347. *** 2120,2136 ****
  348. X  Peter King,
  349. X  Tom Kloos,
  350. X  Casey Leedom,
  351. X  Dave Lewis, 
  352. X  Rick Linck,
  353. X  Soren Lundsgaard,
  354. X  Tad Mannes,
  355. X  Rob McMahon,
  356. ! Chris Metcalf
  357. X  Mark Nagel,
  358. ! Ulf Noren
  359. X  Marius Olafsson,
  360. X  Gene H. Olson,
  361. X  Rick Perry,
  362. X  Eric Putz,
  363. X  Jim Richardson,
  364. X  Michael Richardson,
  365. --- 2146,2165 ----
  366. X  Peter King,
  367. X  Tom Kloos,
  368. X  Casey Leedom,
  369. + Jay Lepreau
  370. X  Dave Lewis, 
  371. X  Rick Linck,
  372. X  Soren Lundsgaard,
  373. X  Tad Mannes,
  374. X  Rob McMahon,
  375. ! Chris Metcalf,
  376. X  Mark Nagel,
  377. ! Ulf Noren,
  378. X  Marius Olafsson,
  379. X  Gene H. Olson,
  380. + Henk P. Penning,
  381. X  Rick Perry,
  382. + Larry Philps,
  383. X  Eric Putz,
  384. X  Jim Richardson,
  385. X  Michael Richardson,
  386. ***************
  387. *** 2138,2146 ****
  388. --- 2167,2180 ----
  389. X  Kim Sanders,
  390. X  Mike Schwartz,
  391. X  Alan Silverstein,
  392. + Lowell Skoog,
  393. + Herr Soeryantono,
  394. + Tim Theisen,
  395. X  Tom Tkacik,
  396. X  Andy Valencia,
  397. X  Adri Verhoef,
  398. + Rick Walker,
  399. + Petri Wessman,
  400. X  and
  401. X  Tim Wilson.
  402. X  .\" end of man page
  403. *** 6.16    1991/06/04 18:57:22
  404. --- psc.doc    1991/09/04 14:28:03
  405. ***************
  406. *** 1,5 ****
  407. X  .\" $Revision $
  408. ! .TH PPNAME 1
  409. X  .SH NAME
  410. X  ppname \- prepare pname files
  411. X  .SH SYNOPSIS
  412. --- 1,5 ----
  413. X  .\" $Revision $
  414. ! .TH PPNAME\ #REVISION#\  1
  415. X  .SH NAME
  416. X  ppname \- prepare pname files
  417. X  .SH SYNOPSIS
  418. *** 6.16    1991/06/04 18:57:22
  419. --- tutorial.sc    1991/09/04 14:28:03
  420. ***************
  421. *** 1,96 ****
  422. X  # This data file was generated by the Spreadsheet Calculator.
  423. X  # You almost certainly shouldn't edit it.
  424. X  
  425. ! define "page5" A89
  426. ! define "page1" A9
  427. ! define "page2" A29
  428. ! define "page3" A49
  429. ! define "page4" A70
  430. ! leftstring A1 = "This is a brief sc tutorial."
  431. ! leftstring A3 = "Cells are named by their column and row number.  For example,"
  432. ! leftstring A4 = "Cell A4"
  433. ! leftstring B4 = "Cell B4"
  434. ! leftstring C4 = "Cell C4"
  435. ! leftstring A5 = "Cell A5"
  436. ! leftstring A6 = "Cell A6"
  437. ! leftstring C6 = "Cell C6"
  438. ! leftstring A7 = "Cells range from A0 to ZZ(some number depending on free memory)."
  439. ! leftstring A8 = "Cells can also be named by the user.  See 'range names' in the manual."
  440. X  leftstring page1 = "You can move the cursor a couple of different ways:"
  441. ! leftstring A11 = "^n, j and the <DOWN> arrow key go down"
  442. ! leftstring A12 = "^p, k and the <UP> arrow key go up"
  443. ! leftstring A13 = "^b, h and the <LEFT> arrow key go left"
  444. ! leftstring A14 = "^f, l and the <RIGHT> arrow key go right"
  445. ! leftstring A15 = "You can go directly to a cell by typing 'g' and the cell name. "
  446. ! leftstring A16 = "'g c6' will take you to cell c6."
  447. ! leftstring A18 = "Cells can contain numbers, formulas, or text."
  448. ! leftstring A19 = "Most of the cells on this page contain text."
  449. ! leftstring C20 = "<Type 'g page2' to continue>"
  450. ! leftstring A22 = "Cell d22 contains text"
  451. ! leftstring D22 = "Text "
  452. ! leftstring A23 = "Cell d23 contains a number"
  453. ! let D23 = 123.34
  454. ! leftstring A24 = "Cell d24 contains a formula"
  455. ! let D24 = D23+88
  456. ! leftstring A26 = "To see what the cell contains, just move the cursor"
  457. ! leftstring A27 = "onto the cell.  The contents will show up on line 1 in the brackets."
  458. X  leftstring page2 = "You can enter data into cells like this:"
  459. ! leftstring B30 = "'<text' enters left justified text."
  460. ! leftstring B31 = "'>text' enters right justified text."
  461. ! leftstring B32 = "'=number' enters a number"
  462. ! leftstring B33 = "'=formula' enters a formula."
  463. ! leftstring A35 = "Try duplicating d22 through d24 in e22 though e24."
  464. ! leftstring A37 = "You erase a cell by typing 'x' with the cursor on the cell."
  465. ! leftstring C40 = "<Type 'g page3' to continue>"
  466. ! leftstring A42 = "Here is a typical use for numbers and formulas:"
  467. ! let A44 = 10.3
  468. ! let B44 = 1877.5
  469. ! let C44 = 234.7
  470. ! let E44 = @sum(A44:C44)
  471. ! let A45 = 44.56
  472. ! let B45 = 44.3
  473. ! let C45 = -3
  474. X  let E45 = @sum(A45:C45)
  475. ! let A46 = 88.74
  476. ! let B46 = 8000
  477. ! let C46 = -9
  478. X  let E46 = @sum(A46:C46)
  479. ! let A47 = 99.2
  480. ! let B47 = -88
  481. ! let C47 = -44.6
  482. X  let E47 = @sum(A47:C47)
  483. ! let page3 = @sum(A44:A47)
  484. ! let B49 = @sum(B44:B47)
  485. ! let C49 = @sum(C44:C47)
  486. ! let E49 = @sum(A44:C47)
  487. ! leftstring A51 = "The data is entered in a44 through c47."
  488. ! leftstring A52 = "Cells a49, b49 and c49 sum their respective columns."
  489. ! leftstring A53 = "Cells e44, e45, e46, and e47 sum their respective rows."
  490. ! leftstring A54 = "Cell E49 is a grand total."
  491. ! leftstring A55 = "Try changing some of the data cells and watch the sums change."
  492. ! leftstring A57 = "You can also edit cells by putting the cursor on the cell and typing:"
  493. ! leftstring B58 = "'e' to edit the numeric portion."
  494. ! leftstring B59 = "'E' to edit the string portion."
  495. ! leftstring C60 = "<Type 'g page4' to continue>"
  496. ! leftstring A62 = "Since you are reading this, you know that you can load "
  497. ! leftstring A63 = "a data base from a file by typing the file name as an"
  498. ! leftstring A64 = "argument to the program.  You can also load or save a "
  499. ! leftstring A65 = "data base using the file commands:"
  500. ! leftstring B67 = "'G file'"
  501. ! leftstring C67 = "Gets the data from an sc file."
  502. ! leftstring B68 = "'P file'"
  503. ! leftstring C68 = "Puts the data from the spreadsheet into a file."
  504. X  leftstring page4 = "Try 'P foo.sc' to write this to the file foo.sc"
  505. ! leftstring A71 = "The Get command erases the current spreadsheet.  "
  506. ! leftstring A72 = "To merge a spreadsheet with the one currently in"
  507. ! leftstring A73 = "the machine, use:"
  508. ! leftstring B75 = "'M file'"
  509. ! leftstring C75 = "Merge the data from a saved sc file."
  510. ! leftstring A77 = "You can also get human readable versions of the data"
  511. ! leftstring A78 = "by using the Write command:"
  512. ! leftstring C80 = "<Type 'g page5' to continue>"
  513. ! leftstring A82 = "Try 'W tut.txt' for a clear text version of the tutorial."
  514. ! leftstring A85 = "This is the end of the tutorial.  We have explored"
  515. ! leftstring A86 = "The basic commands.  Much more detail is available"
  516. ! leftstring A87 = "in the man page."
  517. ! leftstring D91 = "GOOD LUCK!"
  518. --- 1,99 ----
  519. X  # This data file was generated by the Spreadsheet Calculator.
  520. X  # You almost certainly shouldn't edit it.
  521. X  
  522. ! define "page4" A71
  523. ! define "page3" A50
  524. ! define "page2" A30
  525. ! define "page1" A11
  526. ! define "page5" A90
  527. ! leftstring A1 = "This is a brief sc tutorial, best run in a 24-line window."
  528. ! leftstring A2 = "Type 'q' to exit, ^Z to suspend (w/ Job Control)."
  529. ! leftstring A3 = "^G interrupts a command."
  530. ! leftstring A5 = "Cells are named by their column and row number.  For example,"
  531. ! leftstring A6 = "Cell A5"
  532. ! leftstring B6 = "Cell B5"
  533. ! leftstring C6 = "Cell C5"
  534. ! leftstring A7 = "Cell A6"
  535. ! leftstring A8 = "Cell A7"
  536. ! leftstring C8 = "Cell C7"
  537. ! leftstring A9 = "Cells range from A0 to ZZ(some number depending on free memory)."
  538. ! leftstring A10 = "Cells can also be named by the user.  See 'range names' in the manual."
  539. X  leftstring page1 = "You can move the cursor a couple of different ways:"
  540. ! leftstring B12 = "^n, j and the <DOWN> arrow key go down"
  541. ! leftstring B13 = "^p, k and the <UP> arrow key go up"
  542. ! leftstring B14 = "^b, h and the <LEFT> arrow key go left"
  543. ! leftstring B15 = "^f, l and the <RIGHT> arrow key go right"
  544. ! leftstring B16 = "You can go directly to a cell by typing 'g' and the cell name. "
  545. ! leftstring B17 = "'g c6' will take you to cell c6."
  546. ! leftstring A19 = "Cells can contain numbers, formulas, or text."
  547. ! leftstring A20 = "Most of the cells on this page contain text."
  548. ! leftstring C21 = "<Type 'g page2' to continue>"
  549. ! leftstring A23 = "Cell d22 contains text"
  550. ! leftstring D23 = "Text "
  551. ! leftstring A24 = "Cell d23 contains a number"
  552. ! let D24 = 123.34
  553. ! leftstring A25 = "Cell d24 contains a formula"
  554. ! let D25 = D24+88
  555. ! leftstring A27 = "To see what the cell contains, just move the cursor"
  556. ! leftstring A28 = "onto the cell.  The contents will show up on line 1 in the brackets."
  557. X  leftstring page2 = "You can enter data into cells like this:"
  558. ! leftstring B31 = "'<text' enters left justified text."
  559. ! leftstring B32 = "'>text' enters right justified text."
  560. ! leftstring B33 = "'=number' enters a number"
  561. ! leftstring B34 = "'=formula' enters a formula."
  562. ! leftstring A36 = "Try duplicating d22 through d24 in e22 though e24."
  563. ! leftstring A38 = "You erase a cell by typing 'x' with the cursor on the cell."
  564. ! leftstring C41 = "<Type 'g page3' to continue>"
  565. ! leftstring A43 = "Here is a typical use for numbers and formulas:"
  566. ! let A45 = 10.3
  567. ! let B45 = 1877.5
  568. ! let C45 = 234.7
  569. X  let E45 = @sum(A45:C45)
  570. ! let A46 = 44.56
  571. ! let B46 = 44.3
  572. ! let C46 = -3
  573. X  let E46 = @sum(A46:C46)
  574. ! let A47 = 88.74
  575. ! let B47 = 8000
  576. ! let C47 = -9
  577. X  let E47 = @sum(A47:C47)
  578. ! let A48 = 99.2
  579. ! let B48 = -88
  580. ! let C48 = -44.6
  581. ! let E48 = @sum(A48:C48)
  582. ! let page3 = @sum(A45:A48)
  583. ! let B50 = @sum(B45:B48)
  584. ! let C50 = @sum(C45:C48)
  585. ! let E50 = @sum(A45:C48)
  586. ! leftstring A52 = "The data is entered in a44 through c47."
  587. ! leftstring A53 = "Cells a49, b49 and c49 sum their respective columns."
  588. ! leftstring A54 = "Cells e44, e45, e46, and e47 sum their respective rows."
  589. ! leftstring A55 = "Cell E49 is a grand total."
  590. ! leftstring A56 = "Try changing some of the data cells and watch the sums change."
  591. ! leftstring A58 = "You can also edit cells by putting the cursor on the cell and typing:"
  592. ! leftstring B59 = "'e' to edit the numeric portion."
  593. ! leftstring B60 = "'E' to edit the string portion."
  594. ! leftstring C61 = "<Type 'g page4' to continue>"
  595. ! leftstring A63 = "Since you are reading this, you know that you can load "
  596. ! leftstring A64 = "a data base from a file by typing the file name as an"
  597. ! leftstring A65 = "argument to the program.  You can also load or save a "
  598. ! leftstring A66 = "data base using the file commands:"
  599. ! leftstring B68 = "'G file'"
  600. ! leftstring C68 = "Gets the data from an sc file."
  601. ! leftstring B69 = "'P file'"
  602. ! leftstring C69 = "Puts the data from the spreadsheet into a file."
  603. X  leftstring page4 = "Try 'P foo.sc' to write this to the file foo.sc"
  604. ! leftstring A72 = "The Get command erases the current spreadsheet.  "
  605. ! leftstring A73 = "To merge a spreadsheet with the one currently in"
  606. ! leftstring A74 = "the machine, use:"
  607. ! leftstring B76 = "'M file'"
  608. ! leftstring C76 = "Merge the data from a saved sc file."
  609. ! leftstring A78 = "You can also get human readable versions of the data"
  610. ! leftstring A79 = "by using the Write command:"
  611. ! leftstring C81 = "<Type 'g page5' to continue>"
  612. ! leftstring A83 = "Try 'W tut.txt' for a clear text version of the tutorial."
  613. ! leftstring A86 = "This is the end of the tutorial.  We have explored"
  614. ! leftstring A87 = "The basic commands.  Much more detail is available"
  615. ! leftstring A88 = "in the man page."
  616. ! leftstring page5 = "To quit this program, type 'q'."
  617. ! leftstring D92 = "GOOD LUCK!"
  618. *** 6.16    1991/06/04 19:01:32
  619. --- Makefile    1991/09/04 15:14:36
  620. ***************
  621. *** 1,9 ****
  622. ! # Makefile $Revision: 6.16 $
  623. X  #
  624. X  # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
  625. X  #    RE_COMP/REGCMP, and DFLT_PAGER. Most of the other things aren't
  626. X  #    normally changed (see the comments with each)
  627. X  # 2) Select the proper machine/compiler/OS section of code
  628. X  # 3) make install
  629. X  # 4) If you have the command 'file' that uses /etc/magic add the line:
  630. X  #    38    string        Spreadsheet    sc file
  631. --- 1,10 ----
  632. ! # Makefile $Revision: 6.17 $
  633. X  #
  634. X  # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
  635. X  #    RE_COMP/REGCMP, and DFLT_PAGER. Most of the other things aren't
  636. X  #    normally changed (see the comments with each)
  637. X  # 2) Select the proper machine/compiler/OS section of code
  638. + #    for MS-DOS look for the pattern 'MS-DOS'
  639. X  # 3) make install
  640. X  # 4) If you have the command 'file' that uses /etc/magic add the line:
  641. X  #    38    string        Spreadsheet    sc file
  642. ***************
  643. *** 24,29 ****
  644. --- 25,31 ----
  645. X  #MANEXT=1            # reno
  646. X  MANDIR=/usr/man/manl
  647. X  MANEXT=l
  648. + MANMODE=644
  649. X  
  650. X  # This is where the library file (tutorial) goes.
  651. X  #LIBDIR=/usr/local/share/$(name) # reno
  652. ***************
  653. *** 87,93 ****
  654. --- 89,99 ----
  655. X  SAVE=-DSAVENAME=\"$(NAME).SAVE\"
  656. X  
  657. X  # path to crypt
  658. + # most systems
  659. X  CRYPT=-DCRYPT_PATH=\"/bin/crypt\"
  660. + # BSD
  661. + #CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
  662. + # other people?
  663. X  #CRYPT=CRYPT_PATH=\"/usr/local/bin/crypt\"
  664. X  
  665. X  # flags for lint
  666. ***************
  667. *** 116,127 ****
  668. X  IDLOKBAD=-DIDLOKBAD
  669. X  #IDLOKBAD=
  670. X  
  671. ! # IF you have problems w/ your yacc and don't have, say, bison...
  672. ! # look just below for '### YACC PROBLEMS ###' and reverse the define to
  673. ! # use the included, pre-yacc'd copy. First try below.
  674. X  #YACC=yacc
  675. X  YACC=bison -y
  676. X  
  677. X  #### SYSTEM DEFINES ####
  678. X  
  679. X  # Use this for system AIX V3.1
  680. --- 122,138 ----
  681. X  IDLOKBAD=-DIDLOKBAD
  682. X  #IDLOKBAD=
  683. X  
  684. ! # IF you have problems w/ your yacc try bison, Berkeley yacc, or
  685. ! # some other yacc. Some systems don't allow you to
  686. ! # increase the number of terminals (mostly AT&T), SCO's does though.
  687. X  #YACC=yacc
  688. X  YACC=bison -y
  689. X  
  690. + # Command to use to make temporary copies of some source files.
  691. + LN=ln
  692. + #LN=ln -s
  693. + #LN=cp
  694. X  #### SYSTEM DEFINES ####
  695. X  
  696. X  # Use this for system AIX V3.1
  697. ***************
  698. *** 129,135 ****
  699. X  #LDFLAGS=
  700. X  #LIB=-lm -lPW -lcurses
  701. X  
  702. ! # Use this for system V.2
  703. X  #CFLAGS= -O -DSYSV2 
  704. X  #LDFLAGS=
  705. X  #LIB=-lm -lPW -lcurses
  706. --- 140,146 ----
  707. X  #LDFLAGS=
  708. X  #LIB=-lm -lPW -lcurses
  709. X  
  710. ! # Use this for system V.2 (includes: HP-UX 7.05, UNIXPC)
  711. X  #CFLAGS= -O -DSYSV2 
  712. X  #LDFLAGS=
  713. X  #LIB=-lm -lPW -lcurses
  714. ***************
  715. *** 143,151 ****
  716. X  LIB=-lm -lcurses -lPW
  717. X  # with gcc also use:
  718. X  #CC=gcc
  719. ! #CFLAGS=  -DSYSV3 -O -pipe
  720. ! YACC=bison -y
  721. X  
  722. X  # Use this for system V.4
  723. X  #CFLAGS=  -DSYSV4 -DSYSV3 -O
  724. X  #LDFLAGS= -s
  725. --- 154,163 ----
  726. X  LIB=-lm -lcurses -lPW
  727. X  # with gcc also use:
  728. X  #CC=gcc
  729. ! #CFLAGS=  -DSYSV3 -O -pipe -traditional
  730. ! #YACC=bison -y
  731. X  
  732. X  # Use this for system V.4
  733. X  #CFLAGS=  -DSYSV4 -DSYSV3 -O
  734. X  #LDFLAGS= -s
  735. ***************
  736. *** 227,232 ****
  737. --- 239,255 ----
  738. X  #LIB=-lm -lcurses -lPW -lmalloc -lc_s
  739. X  #YACC=yacc -Sm10000
  740. X  
  741. + # Use this for MS-DOS, Microsoft C 5.1 and NDMAKE
  742. + #CC=cl
  743. + #CFLAGS= -AL -O -Fo$*.o
  744. + #LDFLAGS=/noi /st:0x4000
  745. + #LIB=lcurses
  746. + #YACC=bison -y
  747. + #
  748. + #.SUFFIXES : .o .c
  749. + #.c.o:
  750. + #    $(CC) $(CFLAGS) -c $*.c
  751. X  # All of the source files
  752. X  SRC=Makefile cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
  753. X      lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
  754. ***************
  755. *** 237,243 ****
  756. X      screen.o version.o vi.o vmtbl.o xmalloc.o
  757. X  
  758. X  # The documents in the Archive
  759. ! DOCS=README CHANGES sc.doc psc.doc tutorial.sc VMS_NOTES
  760. X  
  761. X  all:    $(name) p$(name) $(name)qref
  762. X  
  763. --- 260,266 ----
  764. X      screen.o version.o vi.o vmtbl.o xmalloc.o
  765. X  
  766. X  # The documents in the Archive
  767. ! DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev
  768. X  
  769. X  all:    $(name) p$(name) $(name)qref
  770. X  
  771. ***************
  772. *** 244,278 ****
  773. X  $(name):$(PAR)     $(OBJS)
  774. X      $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  775. X  
  776. ! ### YACC PROBLEMS ###
  777. ! # IF you have problems w/ your yacc and don't have, say, bison...
  778. ! # for systems that don't allow you to increase the number of terminals
  779. ! # (mostly AT&T) (this will include a Berkeley yacc built gram.c and
  780. ! # y.tab.h) use:
  781. ! #gram.c:    mygram.c
  782. ! #    cp mygram.c gram.c
  783. ! #y.tab.h:    
  784. ! #    cp myy.tab.h y.tab.h 
  785. ! #
  786. ! # Otherwise (most systems)
  787. X  gram.c:    gram.y
  788. X      $(YACC) -d gram.y; mv y.tab.c gram.c
  789. X  y.tab.h:    gram.y
  790. X  
  791. X  
  792. X  p$(name):    psc.c pvmtbl.o pxmalloc.o
  793. !     $(CC) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  794. X  
  795. X  qhelp.c: help.c
  796. X      -rm -f qhelp.c
  797. !     ln help.c qhelp.c
  798. X  
  799. ! $(name)qref:    qhelp.c
  800. !     $(CC) $(LDFLAGS) -DQREF -DSCNAME=\"$(name)\" -o $(name)qref qhelp.c
  801. X  
  802. X  pvmtbl.c: vmtbl.c
  803. X      -rm -f pvmtbl.c
  804. !     ln vmtbl.c pvmtbl.c
  805. X  
  806. X  pvmtbl.o: sc.h pvmtbl.c
  807. X      $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  808. --- 267,301 ----
  809. X  $(name):$(PAR)     $(OBJS)
  810. X      $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  811. X  
  812. ! # Alternative for MS-DOS
  813. ! #$(name):     $(OBJS)
  814. ! #    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  815. X  gram.c:    gram.y
  816. X      $(YACC) -d gram.y; mv y.tab.c gram.c
  817. X  y.tab.h:    gram.y
  818. X  
  819. + # Alternative for MS-DOS
  820. + #gram.c:    gram.y
  821. + #    $(YACC) -d gram.y
  822. + #    mv y_tab.c gram.c
  823. + #
  824. + #y_tab.h:    gram.y
  825. X  
  826. X  p$(name):    psc.c pvmtbl.o pxmalloc.o
  827. !     $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  828. X  
  829. X  qhelp.c: help.c
  830. X      -rm -f qhelp.c
  831. !     ${LN} help.c qhelp.c
  832. X  
  833. ! $(name)qref:    qhelp.c sc.h
  834. !     $(CC) $(CFLAGS) $(LDFLAGS) -DQREF -DSCNAME=\"$(name)\" -o $(name)qref qhelp.c
  835. X  
  836. X  pvmtbl.c: vmtbl.c
  837. X      -rm -f pvmtbl.c
  838. !     ${LN} vmtbl.c pvmtbl.c
  839. X  
  840. X  pvmtbl.o: sc.h pvmtbl.c
  841. X      $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  842. ***************
  843. *** 279,324 ****
  844. X  
  845. X  pxmalloc.c: xmalloc.c
  846. X      -rm -f pxmalloc.c
  847. !     ln xmalloc.c pxmalloc.c
  848. X  
  849. ! pxmalloc.o: sc.h pxmalloc.c
  850. !     $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  851. X  
  852. ! lex.o:    sc.h y.tab.h gram.o lex.c
  853. !     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} -c lex.c
  854. X  
  855. ! sc.o:    sc.h sc.c
  856. !     $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
  857. X  
  858. ! screen.o:    sc.h screen.c
  859. !     $(CC) ${CFLAGS} ${BROKENCURSES} ${INTERNATIONAL} ${SIGVOID} -c screen.c
  860. X  
  861. X  interp.o:    interp.c sc.h
  862. X      $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} -c interp.c
  863. X  
  864. ! gram.o:    sc.h y.tab.h
  865. X  
  866. ! cmds.o: cmds.c sc.h
  867. !     $(CC) ${CFLAGS} ${DOBACKUPS} -c cmds.c
  868. X  
  869. ! crypt.o: crypt.c sc.h
  870. !     $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  871. X  
  872. X  range.o: range.c sc.h
  873. X  
  874. ! help.o: help.c sc.h
  875. X  
  876. ! format.o: format.c
  877. X  
  878. X  vi.o: vi.c sc.h
  879. X  
  880. ! gram.o:    sc.h y.tab.h gram.c
  881. !     $(CC) ${CFLAGS} -c gram.c
  882. !     sed<gram.y >experres.h -f eres.sed;sed < gram.y > statres.h -f sres.sed
  883. X  
  884. X  clean:
  885. X      rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \
  886. !     $(name).man p$(name).man p$(name).1 y.output $(name)qref
  887. X  
  888. X  shar: ${SRC} ${DOCS}
  889. X      shar -c -m 64000 -f shar ${DOCS} ${SRC}
  890. --- 302,351 ----
  891. X  
  892. X  pxmalloc.c: xmalloc.c
  893. X      -rm -f pxmalloc.c
  894. !     ${LN} xmalloc.c pxmalloc.c
  895. X  
  896. ! # Objects
  897. X  
  898. ! cmds.o: cmds.c sc.h
  899. !     $(CC) ${CFLAGS} ${DOBACKUPS} -c cmds.c
  900. X  
  901. ! crypt.o: crypt.c sc.h
  902. !     $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  903. X  
  904. ! format.o: format.c
  905. X  
  906. + help.o: help.c sc.h
  907. X  interp.o:    interp.c sc.h
  908. X      $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} -c interp.c
  909. X  
  910. ! gram.o:    sc.h y.tab.h gram.c
  911. !     $(CC) ${CFLAGS} -c gram.c
  912. !     sed < gram.y > experres.h -f eres.sed
  913. !     sed < gram.y > statres.h -f sres.sed
  914. X  
  915. ! lex.o:    sc.h y.tab.h gram.o lex.c
  916. !     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} -c lex.c
  917. X  
  918. ! pxmalloc.o: sc.h pxmalloc.c
  919. !     $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  920. X  
  921. X  range.o: range.c sc.h
  922. X  
  923. ! sc.o:    sc.h sc.c
  924. !     $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
  925. X  
  926. ! screen.o:    sc.h screen.c
  927. !     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKBAD} ${INTERNATIONAL} ${SIGVOID} -c screen.c
  928. X  
  929. X  vi.o: vi.c sc.h
  930. X  
  931. ! # other stuff
  932. X  
  933. X  clean:
  934. X      rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \
  935. !     $(name).man p$(name).man p$(name).1 y.output $(name)qref \
  936. !     pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  937. X  
  938. X  shar: ${SRC} ${DOCS}
  939. X      shar -c -m 64000 -f shar ${DOCS} ${SRC}
  940. ***************
  941. *** 347,354 ****
  942. X      prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
  943. X  
  944. X  $(name).1:    sc.doc
  945. !     sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  946. !        -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  947. X  
  948. X  $(name).man:    $(name).1
  949. X      nroff -man $(name).1 > $(name).man
  950. --- 374,386 ----
  951. X      prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
  952. X  
  953. X  $(name).1:    sc.doc
  954. !     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  955. ! #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  956. ! #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  957. ! #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.17 $(
  958. ! #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  959. ! #        -e s%#LIBDIR#%$(LIBDIR)%g \
  960. ! #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  961. X  
  962. X  $(name).man:    $(name).1
  963. X      nroff -man $(name).1 > $(name).man
  964. ***************
  965. *** 357,369 ****
  966. X      itpf -x -Pim2 -man $(name).1
  967. X  
  968. X  p$(name).1:    psc.doc
  969. !     sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc >  p$(name).1
  970. X  
  971. X  p$(name).man:    p$(name).1
  972. X      nroff -man p$(name).1 > p$(name).man
  973. X  
  974. X  install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
  975. !      $(LIBDIR)/tutorial $(MANDIR)/$(name).$(MANEXT)
  976. X  
  977. X  $(EXDIR)/$(name): $(name)
  978. X      cp $(name) $(EXDIR)
  979. --- 389,403 ----
  980. X      itpf -x -Pim2 -man $(name).1
  981. X  
  982. X  p$(name).1:    psc.doc
  983. !     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
  984. ! #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc >  p$(name).1
  985. X  
  986. X  p$(name).man:    p$(name).1
  987. X      nroff -man p$(name).1 > p$(name).man
  988. X  
  989. X  install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
  990. !      $(LIBDIR)/tutorial \
  991. !      $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  992. X  
  993. X  $(EXDIR)/$(name): $(name)
  994. X      cp $(name) $(EXDIR)
  995. ***************
  996. *** 379,384 ****
  997. --- 413,419 ----
  998. X  
  999. X  $(LIBDIR)/tutorial: tutorial.sc $(LIBDIR)
  1000. X      cp tutorial.sc $(LIBDIR)/tutorial.$(name)
  1001. +     chmod $(MANMODE) $(LIBDIR)/tutorial.$(name)
  1002. X  
  1003. X  $(LIBDIR):
  1004. X      mkdir $(LIBDIR)
  1005. ***************
  1006. *** 385,395 ****
  1007. X  
  1008. X  $(MANDIR)/$(name).$(MANEXT): $(name).1
  1009. X      cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
  1010. X  
  1011. X  diffs: ${SRC}
  1012. !     for i in ${SRC} ${DOCS} ;\
  1013. X          do \
  1014. !         rcsdiff -c -r6.11 $$i ;\
  1015. X          done
  1016. X  
  1017. X  # THA 10/14/90  Added code to make a patchfile
  1018. --- 420,435 ----
  1019. X  
  1020. X  $(MANDIR)/$(name).$(MANEXT): $(name).1
  1021. X      cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
  1022. +     chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  1023. + $(MANDIR)/p$(name).$(MANEXT): p$(name).1
  1024. +     cp p$(name).1 $(MANDIR)/p$(name).$(MANEXT)
  1025. +     chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  1026. X  
  1027. X  diffs: ${SRC}
  1028. !     for i in ${DOCS} ${SRC}  ;\
  1029. X          do \
  1030. !         rcsdiff -c -r6.16 $$i ;\
  1031. X          done
  1032. X  
  1033. X  # THA 10/14/90  Added code to make a patchfile
  1034. ***************
  1035. *** 399,401 ****
  1036. --- 439,444 ----
  1037. X          do \
  1038. X          diffc $$i /users/toma/sc/sc6.12/$$i >> patchfile ;\
  1039. X          done
  1040. + files:
  1041. +     @find $(DOCS) $(SRC) -print
  1042. *** 6.16    1991/06/04 18:57:22
  1043. --- cmds.c    1991/09/04 14:28:06
  1044. ***************
  1045. *** 7,13 ****
  1046. X   *
  1047. X   *              More mods Robert Bond, 12/86
  1048. X   *
  1049. !  *        $Revision: 6.16 $
  1050. X   */
  1051. X  
  1052. X  #include <sys/types.h>
  1053. --- 7,13 ----
  1054. X   *
  1055. X   *              More mods Robert Bond, 12/86
  1056. X   *
  1057. !  *        $Revision: 6.17 $
  1058. X   */
  1059. X  
  1060. X  #include <sys/types.h>
  1061. ***************
  1062. *** 118,128 ****
  1063. X  deleterow(arg)
  1064. X  register int arg;
  1065. X  {
  1066. !     flush_saved();
  1067. !     erase_area(currow, 0, currow + arg - 1, maxcol);
  1068. !     currow += arg;
  1069. !     while (--arg>=0) closerow (--currow);
  1070. !     sync_refs();
  1071. X  }
  1072. X  
  1073. X  void
  1074. --- 118,132 ----
  1075. X  deleterow(arg)
  1076. X  register int arg;
  1077. X  {
  1078. !     if (any_locked_cells(currow, 0, currow + arg - 1, maxcol))
  1079. !     error("Locked cells encountered. Nothing changed");
  1080. !     else {
  1081. !         flush_saved();
  1082. !         erase_area(currow, 0, currow + arg - 1, maxcol);
  1083. !         currow += arg;
  1084. !         while (--arg>=0) closerow (--currow);
  1085. !         sync_refs();
  1086. !     }
  1087. X  }
  1088. X  
  1089. X  void
  1090. ***************
  1091. *** 149,155 ****
  1092. X      for (r = sr; r <= er; r++) {
  1093. X      for (c = sc; c <= ec; c++) {
  1094. X          pp = ATBL(tbl, r, c);
  1095. !         if (*pp) {
  1096. X          free_ent(*pp);
  1097. X          *pp = (struct ent *)0;
  1098. X          }
  1099. --- 153,159 ----
  1100. X      for (r = sr; r <= er; r++) {
  1101. X      for (c = sc; c <= ec; c++) {
  1102. X          pp = ATBL(tbl, r, c);
  1103. !         if (*pp && !((*pp)->flags&is_locked)) {
  1104. X          free_ent(*pp);
  1105. X          *pp = (struct ent *)0;
  1106. X          }
  1107. ***************
  1108. *** 185,190 ****
  1109. --- 189,198 ----
  1110. X      for (r = sr; r <= er; r++) {
  1111. X      for (c = sc; c <= ec; c++) {
  1112. X          p = *ATBL(tbl, r, c);
  1113. +         if (p->flags&is_locked) {
  1114. +         error(" Cell %s%d is locked", coltoa(c), r);
  1115. +         continue;
  1116. +         }
  1117. X          if (p && p->expr) {
  1118. X          efree(p->expr);
  1119. X          p->expr = (struct enode *)0;
  1120. ***************
  1121. *** 470,475 ****
  1122. --- 478,487 ----
  1123. X      error(buf);
  1124. X      return;
  1125. X      }
  1126. +     if (any_locked_cells(0, curcol, maxrow, curcol + numcol - 1)) {
  1127. +     error("Locked cells encountered. Nothing changed");
  1128. +     return;
  1129. +     }
  1130. X      flush_saved();
  1131. X      erase_area(0, curcol, maxrow, curcol + numcol - 1);
  1132. X      sync_refs();
  1133. ***************
  1134. *** 619,625 ****
  1135. X      }
  1136. X  
  1137. X      for(i = c1; i<=c2; i++)
  1138. !     fwidth[i] = w, precision[i] = p, realfmt[i] = r;
  1139. X  
  1140. X      FullUpdate++;
  1141. X      modflg++;
  1142. --- 631,637 ----
  1143. X      }
  1144. X  
  1145. X      for(i = c1; i<=c2; i++)
  1146. !         fwidth[i] = w, precision[i] = p, realfmt[i] = r;
  1147. X  
  1148. X      FullUpdate++;
  1149. X      modflg++;
  1150. ***************
  1151. *** 1173,1178 ****
  1152. --- 1185,1194 ----
  1153. X      return(fopen(efname, "w"));
  1154. X      }
  1155. X  
  1156. + #if defined(MSDOS)
  1157. +     error("Piping not available under MS-DOS\n");
  1158. +     return(0);
  1159. + #else
  1160. X      fname++;                /* Skip | */
  1161. X      if ( pipe (pipefd) < 0) {
  1162. X      error("Can't make pipe to child");
  1163. ***************
  1164. *** 1208,1213 ****
  1165. --- 1224,1230 ----
  1166. X      }
  1167. X  #endif /* VMS */
  1168. X      return(f);
  1169. + #endif /* MSDOS */
  1170. X  }
  1171. X  
  1172. X  /* close a file opened by openout(), if process wait for return */
  1173. ***************
  1174. *** 1219,1224 ****
  1175. --- 1236,1242 ----
  1176. X      int temp;
  1177. X  
  1178. X      (void) fclose (f);
  1179. + #if !defined(MSDOS)
  1180. X      if (pid) {
  1181. X           while (pid != wait(&temp)) /**/;
  1182. X       (void) printf("Press RETURN to continue ");
  1183. ***************
  1184. *** 1226,1231 ****
  1185. --- 1244,1250 ----
  1186. X       (void) nmgetch();
  1187. X       goraw();
  1188. X      }
  1189. + #endif /* MSDOS */
  1190. X  }
  1191. X  
  1192. X  void
  1193. ***************
  1194. *** 1295,1300 ****
  1195. --- 1314,1322 ----
  1196. X              editfmt (r, c);
  1197. X              (void) fprintf (f, "%s\n",line);
  1198. X          }
  1199. +         if ((*pp)->flags&is_locked)
  1200. +             (void) fprintf(f, "lock %s%d\n", coltoa((*pp)->col),
  1201. +                              (*pp)->row) ;
  1202. X          }
  1203. X      }
  1204. X      if (rndinfinity)
  1205. ***************
  1206. *** 1310,1316 ****
  1207. X      char save[PATHLEN];
  1208. X      int pid;
  1209. X  
  1210. ! #ifndef VMS
  1211. X      if (Crypt) {
  1212. X      return (cwritefile(fname, r0, c0, rn, cn));
  1213. X      }
  1214. --- 1332,1338 ----
  1215. X      char save[PATHLEN];
  1216. X      int pid;
  1217. X  
  1218. ! #if !defined(VMS) && !defined(MSDOS)
  1219. X      if (Crypt) {
  1220. X      return (cwritefile(fname, r0, c0, rn, cn));
  1221. X      }
  1222. ***************
  1223. *** 1360,1366 ****
  1224. X          (void) strcpy(save,fname);
  1225. X      }
  1226. X  
  1227. ! #ifndef VMS
  1228. X      if (Crypt)  {
  1229. X      creadfile(save, eraseflg);
  1230. X      return;
  1231. --- 1382,1388 ----
  1232. X          (void) strcpy(save,fname);
  1233. X      }
  1234. X  
  1235. ! #if !defined(VMS) && !defined(MSDOS)
  1236. X      if (Crypt)  {
  1237. X      creadfile(save, eraseflg);
  1238. X      return;
  1239. ***************
  1240. *** 1559,1564 ****
  1241. --- 1581,1587 ----
  1242. X      if (e == (struct enode *)0)
  1243. X      return NUM;
  1244. X      switch (e->op) {
  1245. +     case UPPER: case LOWER: case CAPITAL:
  1246. X      case O_SCONST: case '#': case DATE: case FMT: case STINDEX:
  1247. X      case EXT: case SVAL: case SUBSTR:
  1248. X          return (STR);
  1249. ***************
  1250. *** 1610,1616 ****
  1251. --- 1633,1641 ----
  1252. X  }
  1253. X  
  1254. X  /* expand a ~ in a path to your home directory */
  1255. + #if !defined(MSDOS)
  1256. X  #include <pwd.h>
  1257. + #endif
  1258. X  char    *
  1259. X  findhome(path)
  1260. X  char    *path;
  1261. ***************
  1262. *** 1631,1636 ****
  1263. --- 1656,1662 ----
  1264. X          if ((*pathptr == '/') || (*pathptr == '\0'))
  1265. X          {    strcpy(tmppath, HomeDir);
  1266. X          }
  1267. + #if !defined(MSDOS)
  1268. X          else
  1269. X          {    struct    passwd *pwent;
  1270. X              extern    struct    passwd *getpwnam();
  1271. ***************
  1272. *** 1647,1653 ****
  1273. X              }
  1274. X              strcpy(tmppath, pwent->pw_dir);
  1275. X          }
  1276. X          strcat(tmppath, pathptr);
  1277. X          strcpy(path, tmppath);
  1278. X      }
  1279. --- 1673,1679 ----
  1280. X              }
  1281. X              strcpy(tmppath, pwent->pw_dir);
  1282. X          }
  1283. ! #endif
  1284. X          strcat(tmppath, pathptr);
  1285. X          strcpy(path, tmppath);
  1286. X      }
  1287. *** 6.16    1991/06/04 18:57:22
  1288. --- crypt.c    1991/09/04 14:28:07
  1289. ***************
  1290. *** 2,8 ****
  1291. X   * Encryption utilites
  1292. X   * Bradley Williams    
  1293. X   * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
  1294. !  * $Revision: 6.16 $
  1295. X   */
  1296. X  
  1297. X  #include <stdio.h>
  1298. --- 2,8 ----
  1299. X   * Encryption utilites
  1300. X   * Bradley Williams    
  1301. X   * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
  1302. !  * $Revision: 6.17 $
  1303. X   */
  1304. X  
  1305. X  #include <stdio.h>
  1306. ***************
  1307. *** 66,72 ****
  1308. X      (void) dup (pipefd[1]);          /* connect to pipe */
  1309. X      (void) fprintf (stderr, " ");
  1310. X      (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
  1311. X      exit (-127);
  1312. X      }
  1313. X      else                  /* else parent */
  1314. --- 66,73 ----
  1315. X      (void) dup (pipefd[1]);          /* connect to pipe */
  1316. X      (void) fprintf (stderr, " ");
  1317. X      (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
  1318. !     (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in creadfile() failed",
  1319. !             CRYPT_PATH, KeyWord);
  1320. X      exit (-127);
  1321. X      }
  1322. X      else                  /* else parent */
  1323. ***************
  1324. *** 158,163 ****
  1325. --- 159,166 ----
  1326. X      (void) dup (fildes);              /* standard out to file */
  1327. X      (void) fprintf (stderr, " ");
  1328. X      (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
  1329. +     (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in cwritefile() failed",
  1330. +             CRYPT_PATH, KeyWord);
  1331. X      exit (-127);
  1332. X      }
  1333. X      else                  /* else parent */
  1334. *** 6.16    1991/06/04 18:57:22
  1335. --- format.c    1991/09/04 14:28:08
  1336. ***************
  1337. *** 3,9 ****
  1338. X   * Mark Nagel <nagel@ics.uci.edu>
  1339. X   * 20 July 1989
  1340. X   *
  1341. !  * $Revision: 6.16 $
  1342. X   *
  1343. X   * bool
  1344. X   * format(fmt, num, buf, buflen)
  1345. --- 3,9 ----
  1346. X   * Mark Nagel <nagel@ics.uci.edu>
  1347. X   * 20 July 1989
  1348. X   *
  1349. !  * $Revision: 6.17 $
  1350. X   *
  1351. X   * bool
  1352. X   * format(fmt, num, buf, buflen)
  1353. *** 6.16    1991/06/04 18:57:22
  1354. --- gram.y    1991/09/04 14:28:09
  1355. ***************
  1356. *** 9,15 ****
  1357. X   *
  1358. X   *        More mods by Alan Silverstein, 3/88, see list of changes.
  1359. X   *
  1360. !  *        $Revision: 6.16 $
  1361. X   */
  1362. X  
  1363. X  
  1364. --- 9,15 ----
  1365. X   *
  1366. X   *        More mods by Alan Silverstein, 3/88, see list of changes.
  1367. X   *
  1368. !  *        $Revision: 6.17 $
  1369. X   */
  1370. X  
  1371. X  
  1372. ***************
  1373. *** 60,65 ****
  1374. --- 60,67 ----
  1375. X  %token S_SHOW
  1376. X  %token S_ERASE
  1377. X  %token S_FILL
  1378. + %token S_LOCK
  1379. + %token S_UNLOCK
  1380. X  %token S_GOTO
  1381. X  %token S_DEFINE
  1382. X  %token S_UNDEFINE
  1383. ***************
  1384. *** 118,123 ****
  1385. --- 120,128 ----
  1386. X  %token K_TTS
  1387. X  %token K_FMT
  1388. X  %token K_SUBSTR
  1389. + %token K_UPPER
  1390. + %token K_LOWER
  1391. + %token K_CAPITAL
  1392. X  %token K_STON
  1393. X  %token K_EQS
  1394. X  %token K_EXT
  1395. ***************
  1396. *** 236,241 ****
  1397. --- 241,256 ----
  1398. X                  { fill($2.left.vp, $2.right.vp, $3, $4); }
  1399. X      |    S_FMT var_or_range STRING
  1400. X                  { format_cell($2.left.vp, $2.right.vp, $3); }
  1401. +     |    S_LOCK       
  1402. +                     { lock_cells(lookat(showsr, showsc),
  1403. +                         lookat(currow, curcol)); }
  1404. +     |    S_LOCK var_or_range
  1405. +                 { lock_cells($2.left.vp, $2.right.vp); }
  1406. +     |    S_UNLOCK       
  1407. +                     { unlock_cells(lookat(showsr, showsc),
  1408. +                         lookat(currow, curcol)); }
  1409. +     |    S_UNLOCK var_or_range
  1410. +                 { unlock_cells($2.left.vp, $2.right.vp); }
  1411. X      |    S_GOTO var_or_range {moveto($2.left.vp->row, $2.left.vp->col);}
  1412. X      |       S_GOTO num        { num_search($2, 0); }
  1413. X      |       S_GOTO errlist
  1414. ***************
  1415. *** 320,325 ****
  1416. --- 335,343 ----
  1417. X      | '@' K_EQS '(' e ',' e ')'    { $$ = new (EQS, $4, $6); }
  1418. X      | '@' K_DATE '(' e ')'        { $$ = new(DATE, ENULL, $4); }
  1419. X      | '@' K_FMT  '(' e ',' e ')'    { $$ = new(FMT, $4, $6); }
  1420. +     | '@' K_UPPER '(' e ')'        { $$ = new(UPPER, ENULL, $4); }
  1421. +     | '@' K_LOWER '(' e ')'        { $$ = new(LOWER, ENULL, $4); }
  1422. +     | '@' K_CAPITAL '(' e ')'    { $$ = new(CAPITAL, ENULL, $4); }
  1423. X      | '@' K_INDEX  '(' e ',' var_or_range ')'
  1424. X           { $$ = new(INDEX, $4, new_range(REDUCE | INDEX, $6)); }
  1425. X      | '@' K_LOOKUP  '(' e ',' var_or_range ')'
  1426. ***************
  1427. *** 343,348 ****
  1428. --- 361,367 ----
  1429. X      |    NUMBER        { $$ = new_const(O_CONST, (double) $1); }
  1430. X      |    FNUMBER        { $$ = new_const(O_CONST, $1); }
  1431. X      |    K_PI { $$ = new_const(O_CONST, (double)3.14159265358979323846); }
  1432. +     | '@'   K_PI { $$ = new_const(O_CONST, (double)3.14159265358979323846); }
  1433. X      |    STRING            { $$ = new_str($1); }
  1434. X      |    '~' term    { $$ = new ('~', ENULL, $2); }
  1435. X      |    '!' term    { $$ = new ('~', ENULL, $2); }
  1436. ***************
  1437. *** 367,372 ****
  1438. --- 386,392 ----
  1439. X      |    e '|' e        { $$ = new ('|', $1, $3); }
  1440. X      |    e '<' '=' e    { $$ = new ('~', ENULL, new ('>', $1, $4)); }
  1441. X      |    e '!' '=' e    { $$ = new ('~', ENULL, new ('=', $1, $4)); }
  1442. +     |    e '<' '>' e    { $$ = new ('~', ENULL, new ('=', $1, $4)); }
  1443. X      |    e '>' '=' e    { $$ = new ('~', ENULL, new ('<', $1, $4)); }
  1444. X      |    e '#' e        { $$ = new ('#', $1, $3); }
  1445. X      ;
  1446. *** 6.16    1991/06/04 18:57:22
  1447. --- help.c    1991/09/04 14:57:06
  1448. ***************
  1449. *** 2,13 ****
  1450. X   * Help functions for sc 
  1451. X   * R. Bond, 1988
  1452. X   * J. Buhrt 1990
  1453. !  * $Revision: 6.16 $
  1454. X   */
  1455. X  
  1456. X  #ifdef QREF
  1457. X  #include <stdio.h>
  1458. ! char    *header = " Quick Reference\n\n$Revision: 6.16 $";
  1459. X  #else
  1460. X  #include <curses.h>
  1461. X  #include "sc.h"
  1462. --- 2,13 ----
  1463. X   * Help functions for sc 
  1464. X   * R. Bond, 1988
  1465. X   * J. Buhrt 1990
  1466. !  * $Revision: 6.17 $
  1467. X   */
  1468. X  
  1469. X  #ifdef QREF
  1470. X  #include <stdio.h>
  1471. ! char    *header = " Quick Reference\n\n$Revision: 6.17 $";
  1472. X  #else
  1473. X  #include <curses.h>
  1474. X  #include "sc.h"
  1475. ***************
  1476. *** 203,208 ****
  1477. --- 203,210 ----
  1478. X  "     /d   Assign a name to a cell or a range of cells.  Give the",
  1479. X  "          the name, surrounded by quotes, and either a cell name such",
  1480. X  "          as ``A10'' or a range such as ``a1:b20''.",
  1481. + "     /l   Locks a cell or a range of cells, i.e makes it unchangeable.",
  1482. + "     /U   Unlocks a locked cell, i.e makes it changeable.",
  1483. X  "     /s   Shows the currently defined range names.  Pipe output to",
  1484. X  "          sort, then to less.",
  1485. X  "     /u   Use this command to undefine a previously defined range name.",
  1486. ***************
  1487. *** 321,327 ****
  1488. X  char *stringf[] = {
  1489. X  " ",
  1490. X  " M: String functions:",
  1491. - " ",
  1492. X  "     #                 Concatenate strings.  For example, the",
  1493. X  "                       string expression ``A0 # \"zy dog\"'' yields",
  1494. X  "                       ``the lazy dog'' if A0 is ``the la''.",
  1495. --- 323,328 ----
  1496. ***************
  1497. *** 338,344 ****
  1498. X  "                       to the command line as an argument.  @ext yields",
  1499. X  "                       a string: the first line printed to standard",
  1500. X  "                       output by the command.",
  1501. ! "     @coltoa(e)        Return a column letter(s) from the passed number",
  1502. X  "     String expressions are made up of constant strings (characters",
  1503. X  "     surrounded by quotes), variables, and string functions.",
  1504. X  (char *)0
  1505. --- 339,347 ----
  1506. X  "                       to the command line as an argument.  @ext yields",
  1507. X  "                       a string: the first line printed to standard",
  1508. X  "                       output by the command.",
  1509. ! "     @coltoa(e)        Return the column letter(s) from the passed number",
  1510. ! "     @upper(e) @lower(e)   Return the string in upper/lower case",
  1511. ! "     @capital(e)       Return the string with words in upper case",
  1512. X  "     String expressions are made up of constant strings (characters",
  1513. X  "     surrounded by quotes), variables, and string functions.",
  1514. X  (char *)0
  1515. *** 6.16    1991/06/04 18:55:36
  1516. --- interp.c    1991/09/04 14:28:13
  1517. ***************
  1518. *** 7,13 ****
  1519. X   *
  1520. X   *              More mods Robert Bond, 12/86
  1521. X   *        More mods by Alan Silverstein, 3-4/88, see list of changes.
  1522. !  *        $Revision: 6.16 $
  1523. X   */
  1524. X  
  1525. X  #define DEBUGDTS 1        /* REMOVE ME */
  1526. --- 7,13 ----
  1527. X   *
  1528. X   *              More mods Robert Bond, 12/86
  1529. X   *        More mods by Alan Silverstein, 3-4/88, see list of changes.
  1530. !  *        $Revision: 6.17 $
  1531. X   */
  1532. X  
  1533. X  #define DEBUGDTS 1        /* REMOVE ME */
  1534. ***************
  1535. *** 25,30 ****
  1536. --- 25,31 ----
  1537. X  #include <signal.h>
  1538. X  #include <setjmp.h>
  1539. X  #include <stdio.h>
  1540. + #include <ctype.h>
  1541. X  
  1542. X  extern int errno;        /* set by math functions */
  1543. X  #ifdef BSD42
  1544. ***************
  1545. *** 740,746 ****
  1546. X              num = eval(e->e.o.left);
  1547. X              denom = eval(e->e.o.right);
  1548. X              if (denom)
  1549. ! /*            if (1)*/
  1550. X                  return(num/denom);
  1551. X              else
  1552. X              {    cellerror = CELLERROR;
  1553. --- 741,747 ----
  1554. X              num = eval(e->e.o.left);
  1555. X              denom = eval(e->e.o.right);
  1556. X              if (denom)
  1557. ! /*            if (1)    /* to test num div 0 */
  1558. X                  return(num/denom);
  1559. X              else
  1560. X              {    cellerror = CELLERROR;
  1561. ***************
  1562. *** 1022,1028 ****
  1563. X   * written to files, etc.
  1564. X   */
  1565. X  
  1566. ! #ifdef VMS
  1567. X  char *
  1568. X  doext(command, value)
  1569. X  char *command;
  1570. --- 1023,1029 ----
  1571. X   * written to files, etc.
  1572. X   */
  1573. X  
  1574. ! #if defined(VMS) || defined(MSDOS)
  1575. X  char *
  1576. X  doext(command, value)
  1577. X  char *command;
  1578. ***************
  1579. *** 1029,1035 ****
  1580. X  double value;
  1581. X  {
  1582. X      error("Warning: External functions unavailable on VMS");
  1583. !     cellerror = CELLERROR    /* not sure if this should be a cellerror */
  1584. X      if (command)
  1585. X      xfree(command);
  1586. X      return (strcpy (xmalloc((unsigned) 1), "\0"));
  1587. --- 1030,1036 ----
  1588. X  double value;
  1589. X  {
  1590. X      error("Warning: External functions unavailable on VMS");
  1591. !     cellerror = CELLERROR;    /* not sure if this should be a cellerror */
  1592. X      if (command)
  1593. X      xfree(command);
  1594. X      return (strcpy (xmalloc((unsigned) 1), "\0"));
  1595. ***************
  1596. *** 1157,1162 ****
  1597. --- 1158,1223 ----
  1598. X      return(p);
  1599. X  }
  1600. X  
  1601. + /*
  1602. +  * character casing: make upper case, make lower case
  1603. +  */
  1604. + char *
  1605. + docase( acase, s)
  1606. + int acase;
  1607. + char *s;
  1608. + {
  1609. +     char *p = s;
  1610. +     if (s == NULL)
  1611. +     return(NULL);
  1612. +     if( acase == UPPER ) {
  1613. +         while( *p != '\0' ) {
  1614. +            if( islower(*p) )
  1615. +         *p = toupper(*p);
  1616. +        p++;
  1617. +     }
  1618. +     }
  1619. +     else if ( acase == LOWER ) {
  1620. +     while( *p != '\0' ) {
  1621. +         if (isupper(*p))
  1622. +         *p = tolower(*p);
  1623. +         p++;
  1624. +     }
  1625. +     }
  1626. +     return (s);
  1627. + }
  1628. + /*
  1629. +  * make proper capitals of every word in a string
  1630. +  */
  1631. + char *
  1632. + docapital( s )
  1633. + char *s;
  1634. + {
  1635. +     char *p;
  1636. +     int skip = 1;
  1637. +     if (s == NULL)
  1638. +     return(NULL);
  1639. +     for (p = s; *p != '\0'; p++) {
  1640. +     if (!isalnum(*p))
  1641. +         skip = 1;
  1642. +     else
  1643. +     if (skip == 1) {
  1644. +         skip = 0;
  1645. +         if (islower(*p))
  1646. +             *p = toupper(*p);
  1647. +     }
  1648. +     else    /* if the string was all upper before */
  1649. +     if (isupper(*p))
  1650. +         *p = tolower(*p);
  1651. +     }
  1652. +     return(s);
  1653. + }
  1654. X  char *
  1655. X  seval(se)
  1656. X  register struct enode *se;
  1657. ***************
  1658. *** 1185,1190 ****
  1659. --- 1246,1254 ----
  1660. X                           : seval(se->e.o.right->e.o.right));
  1661. X      case DATE:   return(dodate((long)(eval(se->e.o.right))));
  1662. X      case FMT:    return(dofmt(seval(se->e.o.left), eval(se->e.o.right)));
  1663. +     case UPPER:  return(docase(UPPER, seval(se->e.o.right)));
  1664. +     case LOWER:  return(docase(LOWER, seval(se->e.o.right)));
  1665. +     case CAPITAL:return(docapital(seval(se->e.o.right)));
  1666. X       case STINDEX:
  1667. X           {    register r,c;
  1668. X           register maxr, maxc;
  1669. ***************
  1670. *** 1207,1213 ****
  1671. X      default:
  1672. X               error ("Illegal string expression");
  1673. X               exprerr = 1;
  1674. !              return((char *)0);
  1675. X      }
  1676. X  }
  1677. X  
  1678. --- 1271,1277 ----
  1679. X      default:
  1680. X               error ("Illegal string expression");
  1681. X               exprerr = 1;
  1682. !              return(NULL);
  1683. X      }
  1684. X  }
  1685. X  
  1686. ***************
  1687. *** 1261,1272 ****
  1688. X      if(calc_order == BYROWS ) {
  1689. X      for (i=0; i<=maxrow; i++)
  1690. X          for (j=0; j<=maxcol; j++)
  1691. !         if ((p = *ATBL(tbl,i,j)) && p->expr) RealEvalOne(p,i,j,&chgct);
  1692. X      }
  1693. X      else if ( calc_order == BYCOLS ) {
  1694. X      for (j=0; j<=maxcol; j++)
  1695. X      {   for (i=0; i<=maxrow; i++)
  1696. !         if ((p = *ATBL(tbl,i,j)) && p->expr) RealEvalOne(p,i,j,&chgct);
  1697. X      }
  1698. X      }
  1699. X      else error("Internal error calc_order");
  1700. --- 1325,1336 ----
  1701. X      if(calc_order == BYROWS ) {
  1702. X      for (i=0; i<=maxrow; i++)
  1703. X          for (j=0; j<=maxcol; j++)
  1704. !         if ((p = *ATBL(tbl,i,j)) && !(p->flags&is_locked) && p->expr) RealEvalOne(p,i,j,&chgct);
  1705. X      }
  1706. X      else if ( calc_order == BYCOLS ) {
  1707. X      for (j=0; j<=maxcol; j++)
  1708. X      {   for (i=0; i<=maxrow; i++)
  1709. !         if ((p = *ATBL(tbl,i,j)) && !(p->flags&is_locked) && p->expr) RealEvalOne(p,i,j,&chgct);
  1710. X      }
  1711. X      }
  1712. X      else error("Internal error calc_order");
  1713. ***************
  1714. *** 1308,1315 ****
  1715. X          v = (double)0.0;
  1716. X          } else {
  1717. X          cellerror = CELLOK;
  1718. -         v = eval (p->expr);
  1719. X          gmyrow=i; gmycol=j;
  1720. SHAR_EOF
  1721. true || echo 'restore of pch616-617 failed'
  1722. fi
  1723. echo 'End of  part 1'
  1724. echo 'File pch616-617 is continued in part 2'
  1725. echo 2 > _shar_seq_.tmp
  1726. exit 0
  1727. exit 0 # Just in case...
  1728. exit 0 # Just in case...
  1729. -- 
  1730. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1731. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1732. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1733. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1734.